<article class="" id="post-">
<header class="entry-header">
<h1 class="entry-title">jQuery.error()</h1>
<div class="entry-meta">
						所属分类：<span class="category"><a href="/category/internals/">内部函数</a></span>
<span class="pull-right">英文文档：<a href="https://api.jquery123.com/jQuery.error/" target="_blank">jQuery.error()</a></span>
</div><!-- .entry-meta -->
</header><!-- .entry-header -->
<!-- .entry-header -->
<div class="entry-content">
<article class="entry method" id="jQuery-error1"><h2 class="section-title">
<span class="name">jQuery.error( message )</span><span class="returns">返回: <a href="/Types/#"></a></span>
</h2>
<div class="entry-wrapper">
<p class="desc"><strong>描述: </strong>接受一个字符串，并抛出包含这个字符串的异常。</p>
<ul class="signatures"><li class="signature" id="jQuery-error-message">
<h4 class="name">
<span class="version-details">添加的版本: <a href="/category/version/1.4.1/">1.4.1</a></span>jQuery.error( message )</h4>
<ul><li>
<div><strong>message</strong></div>
<div>类型: <a href="/Types/#String">String</a>
</div>
<div>将要发出的消息.</div>
</li></ul>
</li></ul>
<div class="longdesc" id="entry-longdesc">
<p>这个方法主要是为了让插件开发人员可以重载此方法，并以更好的方式显示错误消息，或者提供更多相关信息。</p>
</div>
<section class="entry-examples" id="entry-examples"><header><h2 class="underline">例子:</h2></header><div class="entry-example" id="example-0">
<h4><span class="desc">重载 jQuery.error 以便可以在 Firebug 中显示。</span></h4>
<div class="syntaxhighlighter javascript ">
<table>
<tbody>
<tr>
<td class="gutter">
<div class="line n1">1</div>
</td>
<td class="code">
<pre><div class="container"><div class="line"><code>jQuery.error = console.error;</code></div></div></pre>
</td>
</tr>
</tbody>
</table>
</div>
</div></section>
</div></article> </div>
</article>